import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { IsInt, IsString, MinLength } from 'class-validator';

export class CreateCookieDto {
  @ApiProperty({
    example: '京东',
    required: true,
  })
  @IsString()
  readonly name: string;
  @ApiProperty({
    example: 'cookie.json',
    required: true,
  })
  @IsString()
  readonly filename: string;

  @ApiProperty({
    example: '[name:afefa,user:faewf]',
    required: true,
  })
  @IsString()
  @MinLength(1, { message: 'Name must not be empty' })
  readonly content: string;

  @ApiProperty({
    example: 1,
    required: true,
  })
  @IsInt()
  @Type(() => Number)
  readonly platformId: number;
}
